package personal.lijun.skeleton.spring.springcloud.serviceprovider.data;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * @Auther: lijun@sstcsoft.com
 * @Date: 2019-10-10 17:15
 */
public class Resource {
    @NotNull(groups = {Resource.UPDATE_GROUP.class},message = "Id不能为空")
    private Short id;

    @Length(groups = {Resource.UPDATE_GROUP.class,Resource.INSERT_GROUP.class},min = 1,max = 50,message = "名称长度为1到50个字符")
    @NotNull(groups = {Resource.INSERT_GROUP.class},message = "名称不能为空")
    private String name;

    @Length(groups = {Resource.UPDATE_GROUP.class,Resource.INSERT_GROUP.class},min = 1,max = 50,message = "编码长度为1到50个字符")
    @NotNull(groups = {Resource.INSERT_GROUP.class},message = "编码不能为空")
    private String code;

    @Length(groups = {Resource.UPDATE_GROUP.class,Resource.INSERT_GROUP.class},min = 1,max = 200,message = "URL长度为1到200个字符")
    @NotNull(groups = {Resource.INSERT_GROUP.class},message = "URL不能为空")
    private String url;

    @Length(groups = {Resource.UPDATE_GROUP.class,Resource.INSERT_GROUP.class},min = 1,max = 200,message = "权限字段长度为1到200个字符")
    @NotNull(groups = {Resource.INSERT_GROUP.class},message = "权限字段不能为空")
    private String permission;

    @NotNull(groups = {Resource.INSERT_GROUP.class},message = "是否锁定不能为空")
    private Boolean locked;

    @NotNull(groups = {Resource.INSERT_GROUP.class},message = "路由ID不能为空")
    private Short routerId;

    private String routerName;

    private Router router;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public Boolean getLocked() {
        return locked;
    }

    public void setLocked(Boolean locked) {
        this.locked = locked;
    }


    public Short getId() {
        return id;
    }

    public void setId(Short id) {
        this.id = id;
    }

    public Short getRouterId() {
        return routerId;
    }

    public void setRouterId(Short routerId) {
        this.routerId = routerId;
    }

    public String getRouterName() {
        return routerName;
    }

    public void setRouterName(String routerName) {
        this.routerName = routerName;
    }

    public Router getRouter() {
        return router;
    }

    public void setRouter(Router router) {
        this.router = router;
    }

    public interface INSERT_GROUP{}

    public interface UPDATE_GROUP{}
}
